<template>
  <transition>
    <div class="dencefog" @click="clickshow" v-show="show">
      <div class="middle-fog">
        <!-- <img src="https://imgs.qunarzz.com/sight/p0/1708/2b/2b3b94de99c0a425a3.img.jpg_710x360_0288385b.jpg" alt=""> -->
        <swiper :options="swiperOptions">
          <swiper-slide v-for="(item,index) of imglist" :key="index">
            <img :src="item" alt />
          </swiper-slide>
          <div class="swiper-pagination" slot="pagination"></div>
        </swiper>
      </div>
    </div>
  </transition>
</template>

<script>
export default {
  name: 'BannerDetail',
  props: {
    imglist: {
      type: Array
    },
    show: Boolean
  },
  methods: {
    clickshow () {
      this.$emit('clickshowbanner')
    }
  },
  data () {
    return {
      swiperOptions: {
        loop: true,
        pagination: {
          el: '.swiper-pagination',
          type: 'fraction'
        }
      }
    }
  }
}
</script>

<style lang="scss">
.v-enter-active,.v-leave-active{
  transition: all 1s;
}
.v-enter,.v-leave-to{
  opacity: 0;
}
.dencefog {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: rgb(34, 32, 32);
  display: flex;
  flex-direction: column;
  justify-content: center;
  .middle-fog {
    width: 100%;
    height: 0;
    overflow: hidden;
    padding-bottom: 50%;
    img {
      width: 100%;
    }
    .swiper-pagination {
      position: absolute;
      bottom: 10px;
      left: 0;
      color: white;
    }
  }
}
</style>
